<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1{
            width: 50px;
            height: 50px;
            background-color: slateblue;
        }

        .container{
            width: 200px;
            height: 200px;
            background-color: tomato;
        }

        .container:hover .box1{
            visibility: hidden;
        }

        .container2{
            margin-top: 20px;
            width: 200px;
            height: 200px;
            background-color: thistle;
        }

        .container:hover+.container2 .box1{
            display: none;
        }
        
    </style>
</head>
<body>
    <!-- 父子hover -->
    <div class="container">
        <div class="box1">

        </div>
    </div>
    <div class="container2">
        <div class="box1">

        </div>
    </div>

</body>
</html>